<html>
    <head>
    	<meta charset="UTF-8">
        <title>表单</title>
        <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    </head>
    <body>
            账号:<input type="text" id="name" placeholder="请输入账号" name="username"><br><br>
            密码:<input type="password" id="pwd" placeholder="请输入密码" name="password"><br><br>
			<input type="submit" onclick="sub()" value="提交">  
         <script>
            function sub(){
            	var name=$("#name").val();
            	var pwd=$("#pwd").val();
            	var data={
            			username:name,
            			password:pwd
            	}
                $.post("http://localhost:8888/boot1/test1",{data:JSON.stringify(data)},function (data){
                    alert(data);
                })
            }
         </script>
    </body>
</html>